#pragma once

#include "NpkCoder.h"

#include <QObject>
#include <QMap>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QStandardPaths>
#include <QFileDialog>
#include <QApplication>
#include <QtDebug>
#include <QDir>
#include <QFileInfo>

class Model : public QObject
{
    Q_OBJECT
public:
    explicit Model(QObject *parent = nullptr);

    QString OpenLoadNpkFileDlg();
    void LoadNpk(const QString &path);
    void OpenExportFileDlg();
    void Export(const QString &outputDirPath);

    const QList<Album> &GetAlbumList();
    QImage GetSpriteImg(const Album &album, const SpriteStruct &sprite);
Q_SIGNALS:
        void LoadNpkFinished();

private:
        QString getFilePathByFileDlg();
        QString getDirPathByFileDlg();
private:
    NpkCoder m_coder;
};
